<HTML>

<HEAD>
        <META NAME="keywords" CONTENT="electronic commerce, ecommerce, ebusiness, e-business, e-commerce, enterprise software, net economy, Netscape, Sun Microsystems, Sun-Netscape Alliance, iPlanet, internet software">
        <META NAME="description" CONTENT="The Sun-Netscape Alliance, a strategic alliance formed by America Online and Sun Microsystems, Inc., is delivering iPlanet e-commerce software and enterprise solutions that enable companies to compete successfully in the Net Economy">
	<META HTTP-EQUIV="Content-Type" content="text/html; charset=ISO-8859-1">
	<META NAME="TEMPLATEBASE" CONTENT="Authored in FrameMaker. Converted to HTML in WebWorks Publisher 2000. manual wdt 1.5">
	<META NAME="LASTUPDATED" CONTENT="09/28/00 13:17:52">
	<TITLE> Core JavaScript Guide 1.5: 1 JavaScript Overview</TITLE>
</HEAD>




<BODY TEXT="#000000" LINK="#666699" VLINK="#666699" ALINK="#333366" BGCOLOR="#FFFFFF">

<MAINCONTENT>

<NAVIGATIONCONTENT>
   <TABLE WIDTH="100%" BORDER="0" CELLSPACING="4">
      <TR>
         <TD VALIGN="TOP">
            <b><a href="preface.html">
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#993300">Previous</a></FONT>&nbsp;&nbsp;&nbsp;&nbsp;</b>
<a href="contents.html">
<b><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#993300">Contents</a></FONT></b>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="ix.html"><b><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#993300">Index</a></FONT></b>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="partcore.html">
<b>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#993300">
Next
</a>
</FONT>
</b>&nbsp;&nbsp;&nbsp;&nbsp;
         </TD>
     </TR>

      <TR>
         <TD VALIGN="TOP" ALIGN="RIGHT" BGCOLOR="#CCCCCC">
            <FONT FACE="Arial, Helvetica, sans-serif" COLOR="#000000" SIZE="2"><B>
             Core JavaScript Guide 1.5</B></FONT>
         </TD>
      </TR>
      <TR>
   </TABLE>
   <BR>
</NAVIGATIONCONTENT>

<BOOKCONTENT>
   <blockquote>
<BR>
<BR>

      <A NAME="1009365"> </A><A NAME=""> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="4" COLOR="#666666"><B>
<zchapnumber>Chapter 1 </zchapnumber>
&nbsp;
</B>
</FONT>


<A NAME="1009367"> </A>
<A NAME="JavaScript Overview"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="4" COLOR="#000000">
<B>
<zchaptitle>JavaScript Overview</zchaptitle>
</B>
</FONT>
<BR>
<BR>
<BR>

<A NAME="1009368"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>This chapter introduces JavaScript, discusses some of its fundamental concepts, and describes the new features in the 1.5 release.</zparagraph>
</FONT>
<P>

<A NAME="1014485"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>This chapter contains the following sections:</zparagraph>
</FONT>
<P>
<ul>
<A NAME="1014490"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1><A HREF="intro.html#1009369"  >What Is JavaScript?</A></zsmartlist1>
</FONT>
<P><A NAME="1016916"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1><A HREF="intro.html#1012569"  >JavaScript and Java</A></zsmartlist1>
</FONT>
<P><A NAME="1016878"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1><A HREF="intro.html#1013654"  >JavaScript and the ECMA Specification</A></zsmartlist1>
</FONT>
<P><A NAME="1023230"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1><A HREF="intro.html#1023167"  >New Features in this Release</A></zsmartlist1>
</FONT>
<P></ul>

<BR>
<BR>

<A NAME="1009369"> </A>
<A NAME="What Is JavaScript?"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="4">
<zhead1>What Is JavaScript?</zhead1>
<HR SIZE="2" NOSHADE>
</FONT>
<BR>


<A NAME="1016749"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>JavaScript is Netscape's cross-platform, object-oriented scripting language. JavaScript is a small, lightweight language; it is not useful as a standalone language, but is designed for easy embedding in other products and applications, such as web browsers. Inside a host environment, JavaScript can be connected to the objects of its environment to provide programmatic control over them.</zparagraph>
</FONT>
<P>

<A NAME="1020496"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>Core JavaScript contains a core set of objects, such as <FONT FACE="courier, couriernew, monospaced size">Array</FONT>, <FONT FACE="courier, couriernew, monospaced size">Date</FONT>, and <FONT FACE="courier, couriernew, monospaced size">Math</FONT>, and a core set of language elements such as operators, control structures, and statements. Core JavaScript can be extended for a variety of purposes by supplementing it with additional objects; for example:</zparagraph>
</FONT>
<P>
<ul>
<A NAME="1016040"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1><I>Client-side JavaScript</I> extends the core language by supplying objects to control a browser (Navigator or another web browser) and its Document Object Model (DOM). For example, client-side extensions allow an application to place elements on an HTML form and respond to user events such as mouse clicks, form input, and page navigation.</zsmartlist1>
</FONT>
<P><A NAME="1016010"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1><I>Server-side JavaScript</I> extends the core language by supplying objects relevant to running JavaScript on a server. For example, server-side extensions allow an application to communicate with a relational database, provide continuity of information from one invocation to another of the application, or perform file manipulations on a server.</zsmartlist1>
</FONT>
<P></ul>

<A NAME="1016777"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>Through JavaScript's LiveConnect functionality, you can let Java and JavaScript code communicate with each other. From JavaScript, you can instantiate Java objects and access their public methods and fields. From Java, you can access JavaScript objects, properties, and methods.</zparagraph>
</FONT>
<P>

<A NAME="1021034"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>Netscape invented JavaScript, and JavaScript was first used in Netscape browsers.</zparagraph>
</FONT>
<P>

<A NAME="1016118"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph></zparagraph>
</FONT>
<P>

<BR>
<BR>

<A NAME="1012569"> </A>
<A NAME="JavaScript and Java"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="4">
<zhead1>JavaScript and Java</zhead1>
<HR SIZE="2" NOSHADE>
</FONT>
<BR>


<A NAME="1019782"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>JavaScript and Java are similar in some ways but fundamentally different in others. The JavaScript language resembles Java but does not have Java's static typing and strong type checking. JavaScript supports most Java expression syntax and basic control-flow constructs.</zparagraph>
</FONT>
<P>

<A NAME="1020614"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system based on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based object model instead of the more common class-based object model. The prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without any special declarative requirements. Functions can be properties of objects, executing as loosely typed methods.</zparagraph>
</FONT>
<P>

<A NAME="1020620"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>JavaScript is a very free-form language compared to Java. You do not have to declare all variables, classes, and methods. You do not have to be concerned with whether methods are public, private, or protected, and you do not have to implement interfaces. Variables, parameters, and function return types are not explicitly typed.</zparagraph>
</FONT>
<P>

<A NAME="1009453"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>Java is a class-based programming language designed for fast execution and type safety. Type safety means, for instance, that you can't cast a Java integer into an object reference or access private memory by corrupting Java bytecodes. Java's class-based model means that programs consist exclusively of classes and their methods. Java's class inheritance and strong typing generally require tightly coupled object hierarchies. These requirements make Java programming more complex than JavaScript authoring.</zparagraph>
</FONT>
<P>

<A NAME="1009454"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>In contrast, JavaScript descends in spirit from a line of smaller, dynamically typed languages such as HyperTalk and dBASE. These scripting languages offer programming tools to a much wider audience because of their easier syntax, specialized built-in functionality, and minimal requirements for object creation.</zparagraph>
</FONT>
<P>

<P>
<A NAME="1014431"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<BR>
<P>
<TABLE WIDTH="90%" BORDER="1" CELLPADDING="5" CELLSPACING="0">
  <CAPTION></CAPTION><P><FONT FACE=""><B>
<A NAME="1009457"> </A>
<A NAME=" JavaScript compared to Java"> </A>
<ALIGN="LEFT">
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>
<ztablecaption>Table 1.1&#32;&nbsp&nbsp  JavaScript compared to Java</ztablecaption>
</B>
</FONT>
</B></FONT>
<BR>
<BR>
  <TR BGCOLOR="#CCCCCC" ALIGN=LEFT VALIGN=TOP>
    <TH VALIGN=TOP ALIGN=LEFT><A NAME="1009461"> </A>
<P ALIGN="LEFT">
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>
<ztablehead>JavaScript</ztablehead>
</B>
</FONT>
</TH>
    <TH VALIGN=TOP ALIGN=LEFT><A NAME="1009463"> </A>
<P ALIGN="LEFT">
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>
<ztablehead>Java</ztablehead>
</B>
</FONT>
</TH>
  </DIV></TR>
  <TR>
    <TD VALIGN=TOP>
<P>
<A NAME="1009469"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>Object-oriented. No distinction between types of objects. Inheritance is through the prototype mechanism, and properties and methods can be added to any object dynamically.</ztabletext>
</FONT>&nbsp;</TD>
    <TD VALIGN=TOP>
<P>
<A NAME="1009471"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>Class-based. Objects are divided into classes and instances with all inheritance through the class hierarchy. Classes and instances cannot have properties or methods added dynamically.</ztabletext>
</FONT>&nbsp;</TD>
  </TR>
  <TR>
    <TD VALIGN=TOP>
<P>
<A NAME="1009477"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>Variable data types not declared (dynamic typing).</ztabletext>
</FONT>&nbsp;</TD>
    <TD VALIGN=TOP>
<P>
<A NAME="1009479"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>Variable data types must be declared (static typing).</ztabletext>
</FONT>&nbsp;</TD>
  </TR>
  <TR>
    <TD VALIGN=TOP>
<P>
<A NAME="1009485"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>Cannot automatically write to hard disk.</ztabletext>
</FONT>&nbsp;</TD>
    <TD VALIGN=TOP>
<P>
<A NAME="1009487"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>Cannot automatically write to hard disk.</ztabletext>
</FONT>&nbsp;</TD>
  </TR>
</TABLE>



<P>
</FONT>
<P>


<A NAME="1020545"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>For more information on the differences between JavaScript and Java, see <A HREF="obj2.html#1013803"  >Chapter 8, "Details of the Object Model."</A></zparagraph>
</FONT>
<P>

<BR>
<BR>

<A NAME="1013654"> </A>
<A NAME="JavaScript and the ECMA Specification"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="4">
<zhead1>JavaScript and the ECMA Specification</zhead1>
<HR SIZE="2" NOSHADE>
</FONT>
<BR>


<A NAME="1020727"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>Netscape invented JavaScript, and JavaScript was first used in Netscape browsers. However, Netscape is working with <A HREF="http://www.ecma.ch">ECMA<font face="fontsansserif" SIZE="5" COLOR="red"></A></font> (European Computer Manufacturers Association) to deliver a standardized, international programming language based on core JavaScript. ECMA is an international standards association for information and communication systems. This standardized version of JavaScript, called ECMAScript, behaves the same way in all applications that support the standard. Companies can use the open standard language to develop their implementation of JavaScript. The first version of the ECMA standard is documented in the ECMA-262 specification.</zparagraph>
</FONT>
<P>

<A NAME="1013667"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>The ECMA-262 standard is also approved by the <A HREF="http://www.iso.ch">ISO<font face="fontsansserif" SIZE="5" COLOR="red"></A></font> (International Organization for Standards) as ISO-16262. You can find a <A HREF="http://developer.netscape.com/docs/javascript/e262-pdf.pdf">PDF version of ECMA-262<font face="fontsansserif" SIZE="5" COLOR="red"></A></font> at the mozilla Web site. You can also find the <A HREF="http://www.ecma.ch/ecma1/stand/ecma-262.htm">specification on the ECMA Web site. The ECMA specification does not describe the Document Object Model (DOM), which is standardized by the <A HREF="http://www.w3.org">World Wide Web Consortium (W3C)<font face="fontsansserif" SIZE="5" COLOR="red"></A></font>. The DOM defines the way in which HTML document objects are exposed to your script.</zparagraph>
</FONT>
<P>
<P>
<BR>
<A NAME="1013678"> </A>
<A NAME="Relationship Between JavaScript and ECMA Versions"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="4">
<zhead2>Relationship Between JavaScript and ECMA Versions</zhead2>
</FONT>
<BR>
<BR>



<A NAME="1014160"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>Netscape works closely with ECMA to produce the ECMA specification. The following table describes the relationship between JavaScript and ECMA versions.</zparagraph>
</FONT>
<P>

<P>
<A NAME="1023535"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<BR>
<P>
<TABLE WIDTH="90%" BORDER="1" CELLPADDING="5" CELLSPACING="0">
  <CAPTION></CAPTION><P><FONT FACE=""><B>
<A NAME="1023502"> </A>
<A NAME="JavaScript and ECMA versions"> </A>
<ALIGN="LEFT">
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>
<ztablecaption>Table 1.2&#32;&nbsp&nbsp JavaScript and ECMA versions</ztablecaption>
</B>
</FONT>
</B></FONT>
<BR>
<BR>
  <TR BGCOLOR="#CCCCCC" ALIGN=LEFT VALIGN=TOP>
    <TH VALIGN=TOP ALIGN=LEFT><A NAME="1023506"> </A>
<P ALIGN="LEFT">
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>
<ztablehead>JavaScript version</ztablehead>
</B>
</FONT>
</TH>
    <TH VALIGN=TOP ALIGN=LEFT><A NAME="1023508"> </A>
<P ALIGN="LEFT">
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>
<ztablehead>Relationship to ECMA version</ztablehead>
</B>
</FONT>
</TH>
  </DIV></TR>
  <TR>
    <TD VALIGN=TOP>
<P>
<A NAME="1023510"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>JavaScript&nbsp;1.1</ztabletext>
</FONT>&nbsp;</TD>
    <TD VALIGN=TOP>
<P>
<A NAME="1023512"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>ECMA-262, Edition 1 is based on JavaScript&nbsp;1.1.</ztabletext>
</FONT>&nbsp;</TD>
  </TR>
  <TR>
    <TD VALIGN=TOP>
<P>
<A NAME="1023514"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>JavaScript&nbsp;1.2</ztabletext>
</FONT>&nbsp;</TD>
    <TD VALIGN=TOP>
<P>
<A NAME="1023516"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>ECMA-262 was not complete when JavaScript&nbsp;1.2 was released. JavaScript&nbsp;1.2 is not fully compatible with ECMA-262, Edition 1, for the following reasons:</ztabletext>
</FONT><ul>
<A NAME="1023517"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1>Netscape developed additional features in JavaScript&nbsp;1.2 that were not considered for ECMA-262.</zsmartlist1>
</FONT>
<P><A NAME="1023518"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1>ECMA-262 adds two new features: internationalization using Unicode, and uniform behavior across all platforms. Several features of JavaScript&nbsp;1.2, such as the <FONT FACE="courier, couriernew, monospaced size">Date</FONT> object, were platform-dependent and used platform-specific behavior.</zsmartlist1>
</FONT>
<P></ul>
&nbsp;</TD>
  </TR>
  <TR>
    <TD VALIGN=TOP>
<P>
<A NAME="1023520"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>JavaScript&nbsp;1.3</ztabletext>
</FONT>&nbsp;</TD>
    <TD VALIGN=TOP>
<P>
<A NAME="1023522"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>JavaScript&nbsp;1.3 is fully compatible with ECMA-262, Edition 1.</ztabletext>
</FONT>
<P>
<A NAME="1023523"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext></ztabletext>
</FONT>
<P>
<A NAME="1023524"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>JavaScript&nbsp;1.3 resolved the inconsistencies that JavaScript&nbsp;1.2 had with ECMA-262, while keeping all the additional features of JavaScript&nbsp;1.2 except == and !=, which were changed to conform with ECMA-262. </ztabletext>
</FONT>&nbsp;</TD>
  </TR>
  <TR>
    <TD VALIGN=TOP>
<P>
<A NAME="1023526"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>JavaScript&nbsp;1.4</ztabletext>
</FONT>&nbsp;</TD>
    <TD VALIGN=TOP>
<P>
<A NAME="1023528"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>JavaScript&nbsp;1.4 is fully compatible with ECMA-262, Edition 1.</ztabletext>
</FONT>
<P>
<A NAME="1023529"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext></ztabletext>
</FONT>
<P>
<A NAME="1023530"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>The third version of the ECMA specification was not finalized when JavaScript&nbsp;1.4 was released.</ztabletext>
</FONT>&nbsp;</TD>
  </TR>
  <TR>
    <TD VALIGN=TOP>
<P>
<A NAME="1023532"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>JavaScript&nbsp;1.5</ztabletext>
</FONT>&nbsp;</TD>
    <TD VALIGN=TOP>
<P>
<A NAME="1023534"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<ztabletext>JavaScript&nbsp;1.5 is fully compatible with ECMA-262, Edition 3.</ztabletext>
</FONT>&nbsp;</TD>
  </TR>
</TABLE>



<P>
</FONT>
<P>


<A NAME="1023542"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>Note: ECMA-262, Edition 2 consisted of minor editorial changes and bug fixes to the Edition 1 specification. The TC39 working group of ECMA is currently working on ECMAScript Edition 4, which will correspond to a future release of JavaScript, JavaScript 2.0.</zparagraph>
</FONT>
<P>

<A NAME="1023558"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>The <A HREF="http://developer.netscape.com/docs/manuals/js/core/jsref/index.htm"><I>Core JavaScript Reference</I></A> indicates which features of the language are ECMA-compliant.</zparagraph>
</FONT>
<P>

<A NAME="1020935"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>JavaScript will always include features that are not part of the ECMA specification; JavaScript is compatible with ECMA, while providing additional features.</zparagraph>
</FONT>
<P>
<P>
<BR>
<A NAME="1013717"> </A>
<A NAME="JavaScript Documentation vs. the ECMA Specification"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="4">
<zhead2>JavaScript Documentation vs. the ECMA Specification</zhead2>
</FONT>
<BR>
<BR>



<A NAME="1013719"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>The ECMA specification is a set of requirements for implementing ECMAScript; it is useful if you want to determine whether a JavaScript feature is supported under ECMA. If you plan to write JavaScript code that uses only features supported by ECMA, then you may need to review the ECMA specification.</zparagraph>
</FONT>
<P>

<A NAME="1013720"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>The ECMA document is not intended to help script programmers; use the JavaScript documentation for information on writing scripts.</zparagraph>
</FONT>
<P>
<P>
<BR>
<A NAME="1013722"> </A>
<A NAME="JavaScript and ECMA Terminology"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="4">
<zhead2>JavaScript and ECMA Terminology</zhead2>
</FONT>
<BR>
<BR>



<A NAME="1013723"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>The ECMA specification uses terminology and syntax that may be unfamiliar to a JavaScript programmer. Although the description of the language may differ in ECMA, the language itself remains the same. JavaScript supports all functionality outlined in the ECMA specification.</zparagraph>
</FONT>
<P>

<A NAME="1013724"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>The JavaScript documentation describes aspects of the language that are appropriate for a JavaScript programmer. For example:</zparagraph>
</FONT>
<P>
<ul>
<A NAME="1013726"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1>The global object is not discussed in the JavaScript documentation because you do not use it directly. The methods and properties of the global object, which you do use, are discussed in the JavaScript documentation but are called top-level functions and properties.</zsmartlist1>
</FONT>
<P><A NAME="1013727"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1>The no parameter (zero-argument) constructor with the <FONT FACE="courier, couriernew, monospaced size">Number</FONT> and <FONT FACE="courier, couriernew, monospaced size">String</FONT> objects is not discussed in the JavaScript documentation, because what is generated is of little use. A <FONT FACE="courier, couriernew, monospaced size">Number</FONT> constructor without an argument returns +0, and a <FONT FACE="courier, couriernew, monospaced size">String</FONT> constructor without an argument returns "" (an empty string).</zsmartlist1>
</FONT>
<P></ul>

<BR>
<BR>

<A NAME="1023167"> </A>
<A NAME="New Features in this Release"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="4">
<zhead1>New Features in this Release</zhead1>
<HR SIZE="2" NOSHADE>
</FONT>
<BR>


<A NAME="1023177"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>JavaScript version 1.5 provides the following new features and enhancements:</zparagraph>
</FONT>
<P>
<ul>
<A NAME="1023178"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1><B>Runtime errors.</B> Runtime errors are now reported as exceptions.</zsmartlist1>
</FONT>
<P><A NAME="1023179"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1><B>Number formatting enhancements.</B> Number formatting has been enhanced to include <FONT FACE="courier, couriernew, monospaced size">Number.prototype.toExponential</FONT>, <FONT FACE="courier, couriernew, monospaced size">Number.protoytpe.toFixed</FONT> and <FONT FACE="courier, couriernew, monospaced size">Number.prototype.toPrecision</FONT> methods. See <A HREF="obj.html#1018310"  >page&nbsp;109</A>.</zsmartlist1>
</FONT>
<P><A NAME="1023183"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1><B>Regular expression enhancements</B>. The following regular expression enhancements have been added:</zsmartlist1>
</FONT>
<P>  <ul>
<A NAME="1023184"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist2>Quantifiers &#151; <FONT FACE="courier, couriernew, monospaced size">+</FONT>, <FONT FACE="courier, couriernew, monospaced size">*</FONT>, <FONT FACE="courier, couriernew, monospaced size">?</FONT> and <FONT FACE="courier, couriernew, monospaced size">{}</FONT>&#151; can now be followed by a <FONT FACE="courier, couriernew, monospaced size">?</FONT> to force them to be non-greedy. See the entry for <FONT FACE="courier, couriernew, monospaced size">?</FONT> on <A HREF="regexp.html#1013259"  >page&nbsp;56</A>.</zsmartlist2>
</FONT>
<P><A NAME="1023387"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist2>Non-capturing parentheses, <FONT FACE="courier, couriernew, monospaced size">(?:x)</FONT> can be used instead of capturing parentheses<FONT FACE="courier, couriernew, monospaced size">(x)</FONT>. When non-capturing parentheses are used, matched subexpressions are not available as back-references. See the entry for <FONT FACE="courier, couriernew, monospaced size">(?:x)</FONT> on <A HREF="regexp.html#1013282"  >page&nbsp;56</A>.</zsmartlist2>
</FONT>
<P><A NAME="1023392"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist2><FONT FACE="courier, couriernew, monospaced size">P</FONT>ositive and negative lookahead assertions are supported. Both assert a match depending on what follows the string being matched. See the entries for <FONT FACE="courier, couriernew, monospaced size">x(?=y)</FONT> and x<FONT FACE="courier, couriernew, monospaced size">(?!y)</FONT> on <A HREF="regexp.html#1013288"  >page&nbsp;56</A>.</zsmartlist2>
</FONT>
<P><A NAME="1023396"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist2>The <FONT FACE="courier, couriernew, monospaced size">m</FONT> flag has been added to specify that the regular expression should match over multiple lines. See <A HREF="regexp.html#1008681"  >page&nbsp;63</A>.</zsmartlist2>
</FONT>
<P>  </ul>
<A NAME="1023203"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1><B>Conditional function declarations.</B> Functions can now be declared inside an <FONT FACE="courier, couriernew, monospaced size">if</FONT> clause. See <A HREF="fcns.html#1008317"  >page&nbsp;84</A>.</zsmartlist1>
</FONT>
<P><A NAME="1023574"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1>Function expressions. Functions can now be declared inside an expression. See <A HREF="fcns.html#1013701"  >page&nbsp;85</A>.</zsmartlist1>
</FONT>
<P><A NAME="1023207"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1><B>Multiple </B><FONT FACE="courier, couriernew, monospaced size"><B>catch</B></FONT><B> clauses. </B>Multiple <FONT FACE="courier, couriernew, monospaced size">catch</FONT> clauses in a <FONT FACE="courier, couriernew, monospaced size">try...catch</FONT> statement are supported. See <A HREF="stmtsov.html#1016086"  >page&nbsp;80</A>.</zsmartlist1>
</FONT>
<P><A NAME="1023211"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1><B>Getters and Setters.</B> JavaScript writers can now add getters and setters to their objects. This feature is available only in the C implementation of JavaScript. See <A HREF="obj.html#1018325"  >page&nbsp;98</A>.</zsmartlist1>
</FONT>
<P><A NAME="1023215"> </A>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">
<B>  <li></B>
<zsmartlist1><B>Constants.</B> Read only named constants are supported. This feature is available only in the C implementation of JavaScript. See <A HREF="ident.html#1012963"  >page&nbsp;27</A>.</zsmartlist1>
</FONT>
<P></ul>

<A NAME="1023174"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph></zparagraph>
</FONT>
<P>



   </BLOCKQUOTE>
</BOOKCONTENT>

<FOOTERCONTENT>
   <BLOCKQUOTE>
 <BR>
            <b><a href="preface.html">
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#993300">Previous</a></FONT>&nbsp;&nbsp;&nbsp;&nbsp;</b>
<a href="contents.html">
<b><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#993300">Contents</a></FONT></b>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="ix.html"><b><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#993300">Index</a></FONT></b>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="partcore.html">
<b>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#993300">
Next
</a>
</FONT>
</b>&nbsp;&nbsp;&nbsp;&nbsp;
        <HR NOSHADE SIZE="1">


   <font face="Arial, Helvetica, sans-serif" SIZE="1">

Copyright &#169; 2000 <a href="http://www.netscape.com">Netscape Communications Corp.</a> All rights reserved.</FONT>
   </BLOCKQUOTE>
   <FONT FACE="Arial, Helvetica, sans-serif" SIZE="1">
   <P ALIGN="RIGHT">Last Updated <B>September 28, 2000</B>
   </FONT>
   <BR>

</FOOTERCONTENT>

</MAINCONTENT>

</BODY>


</HTML>